<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['API接口管理','API接口管控','用户管控配置']" icon="fa fa-bar-chart" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>用户管控配置</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
								<div class="top_module">
									<span class="module_text">用户名</span>
									<div class="s_hover_box">
										<select   class="select2"  id="userNameSelect2">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='delUserName()'>x</div>
									</div>
								</div>
								<div class="selectDate top_module">
									<table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)" ></table-select-date>
								</div>
								<button class="btn btn-primary" (click)="table_search()">查询</button>
								<button class="btn btn-primary" (click)="table_add(userControlModal)">新增</button>
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="tableSearch.searchKey" (change)="table_search()" class="search-input" placeholder="关键字...">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>用户</th>
										<th>到期时间</th>
										<th>更新人</th>
										<th>创建时间</th>
										<th>更新时间</th>
										<th>状态</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" >
										<td>{{row.userName}}</td>
										<td>{{row.expirationDate}}</td>
										<td>{{row.updateUser}}</td>
										<td>{{row.createTime}}</td>
										<td>{{row.updateTime}}</td>
										<td>
											<span *ngIf="row.lockStatus == 0" class="green">正常</span>
											<span *ngIf="row.lockStatus == 1" class="red">锁定</span>
										</td>
										<td>
											<button type="button" (click)="editRow(row,userControlModal)">编辑</button>
											<button type="button" (click)="delRow(row)">刪除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
	<!-- 图片查看   弹窗-->
	<section bsModal #userControlModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="modalClose(userControlModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
					<h4 class="modal-title">用户管控配置 - <span *ngIf="formType == 'new'">新增</span><span *ngIf="formType == 'updata'">编辑</span></h4>
				</div>
				<form id="userControlFrom"  class="form-horizontal" role="form" novalidate="novalidate" [saBootstrapValidator]="validatorOptions">
					<div class="modal-body">
						<div class="row form-horizontal">
							<div class="form-group col-xs-12 s_fix_select2_width s_fix_select2">
								<label class="control-label col-xs-2" for="newPassword">用户<sup>*</sup></label>
								<div class="col-xs-10">
									<input type="hidden"  *ngIf="formType == 'new'" class="form-control" name="userNameFrom" id="userNameFrom" [(ngModel)]='userControlFrom.userName'/>
								    <div class="s_hover_box"  [ngStyle]="{display:formType == 'new'?'block':'none'}">
										<select   class="select2" name="userName" id="userNameSelect2From">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='delUserNameFrom()'>x</div>
									</div>
									<input *ngIf="formType == 'updata'" class="form-control" type="text" name="userName"  disabled [(ngModel)]='userControlFrom.userName'/>
								</div>
							</div>
							<div class="form-group col-xs-12">
								<label class="col-xs-2 control-label">到期时间<sup>*</sup></label>
								<div class="col-xs-10">
									<input class="form-control" type="text"  [(ngModel)]='userControlFrom.expirationDate' name='expirationDate' id="expirationDate" autocomplete="off"/>
								</div>
							</div>
							<div class="form-group col-xs-12">
								<label class="col-xs-2 control-label">状态<sup>*</sup></label>
								<div class="col-xs-10">
									<label class="radio radio-inline" style="margin-right: 40px;">
				                        <input type="radio" class="radiobox" checked [(ngModel)]='userControlFrom.lockStatus' (change)="lockStatusChange($event.target.value)" value='1' name="modal1">
				                        <span>锁定</span>
				                    </label>
				                    <label class="radio radio-inline" style="margin-right: 40px;">
				                        <input type="radio" class="radiobox" [(ngModel)]='userControlFrom.lockStatus' (change)="lockStatusChange($event.target.value)" value='0' name="modal2">
				                        <span>正常</span>
				                    </label>
								</div>
							</div>
							
	                   	</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" (click)="modalClose(userControlModal)">取消</button>
						<button type="button" class="btn btn-primary" (click)="userControlSubmit(userControlModal)">确认</button>
					</div>
				</form>
			</div>
		</div>
	</section>
	<!-- 图片查看 弹窗end-->
</div>